package view;

import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import java.util.Calendar;
import java.util.Date;
import javax.swing.LayoutStyle.ComponentPlacement;

public class FridayPanel extends JPanel {
	public FridayPanel() {
		setBackground(Color.BLACK);
		
		JLabel lblErDetFredag = new JLabel("Er det fredag?");
		lblErDetFredag.setFont(new Font("Lucida Grande", Font.PLAIN, 19));
		lblErDetFredag.setForeground(Color.YELLOW);
		

		JLabel lblJa = new JLabel("");
		lblJa.setFont(new Font("Lucida Grande", Font.PLAIN, 15));
		lblJa.setForeground(Color.RED);

		if(Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY){
			lblJa.setText("JA");
			lblJa.setForeground(Color.GREEN);
		}else{
			lblJa.setText("NEJ");
			lblJa.setForeground(Color.RED);
		}
		
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
					.addContainerGap(294, Short.MAX_VALUE)
					.addComponent(lblErDetFredag)
					.addGap(328))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(342)
					.addComponent(lblJa)
					.addContainerGap(384, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(57)
					.addComponent(lblErDetFredag)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblJa)
					.addContainerGap(345, Short.MAX_VALUE))
		);
		setLayout(groupLayout);
	}

}
